package com.beiding.v2.grammar;

import com.beiding.v2.element.ITable;
import com.beiding.v2.type.FunctionType;

public class Table implements ITable {



    private String name;

    private String alias;

    public Table(String name) {
        this.name = name;
    }

    public Table(String name, String alias) {
        this.name = name;
        this.alias = alias;
    }


    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getAlias() {
        return alias;
    }

    public FieldCapture $(String name) {
        return new FieldCapture(this, name);
    }

    public FieldCapture $count(String name) {
        return $(name).function(FunctionType.count);
    }

}
